package moodish.dummy;

import java.io.Serializable;

import moodish.comm.ServerSideMessage;

/**
 * Messages sent from a clients to the server. A message contains a type (enum), 
 * ,the client's nickname (String) and the payload (String).
 * The payload varies depending on the message type.
 * 
 * @author group27
 * @version 1 
 */


public class ServerSidesMessage implements ServerSideMessage, Serializable {
	
	private String nickname;
	private String payload;
	private Type type;

	public ServerSidesMessage(String nickname, String payload,Type type) {
		this.nickname=nickname;
		this.payload=payload;
		this.type=type;
	}


	/**
	 * Gets the type of the message.
	 * 
	 * @return type of the message.
	 */
	
	@Override
	public Type getType() {
		return type;
	}

	/**
	 * Gets the payload of the message.
	 * 
	 * @return payload.
	 */
	
	@Override
	public String getPayload() {
		return payload;
	}
	
	/**
	 * Gets the sender of the message. 
	 * 
	 * @return nickname of the sender.
	 */
	
	@Override
	public String getClientNickname() {
		return nickname;
	}
	

}
